package com.zhu.tool_test.controller;

import com.linktopa.framework.common.model.response.CommonCode;
import com.linktopa.framework.common.model.response.ObjectResponseResult;
import com.linktopa.framework.common.model.response.ResponseResult;
import com.zhu.tool_test.response.DataFactory;
import com.zhu.tool_test.response.GToolResopnse;
import com.zhu.tool_test.starke.matrix.multipart.core.MultipartData;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: tool_test
 * @description: mock测试
 * @author: ggBall
 * @create: 2020-12-25 10:58
 **/
@RestController
@RequestMapping("/mock")
public class MockTestcontroller  {

    @RequestMapping("/test1")
    public GToolResopnse test1(){
        return DataFactory.createSuccess().build();
    }

    @RequestMapping("/test2")
    public ResponseResult test2() {

        ObjectResponseResult<String> dataObjectResponseResult = new ObjectResponseResult<>(CommonCode.SUCCESS);
        dataObjectResponseResult.setData("sdasdad飒飒大");
        return dataObjectResponseResult;
    }

    @RequestMapping("/test3")
    public ResponseResult test3(@RequestBody MultipartData body) {

        ObjectResponseResult<MultipartData> dataObjectResponseResult = new ObjectResponseResult<>(CommonCode.SUCCESS);
        dataObjectResponseResult.setData(body);
        return dataObjectResponseResult;
    }

}
